package com.ezhanpple.colorpicker

import org.junit.Test

import org.junit.Assert.*

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
class ExampleUnitTest {
    @Test
    fun addition_isCorrect() {
        assertEquals(4, 2 + 2)
        println(compVersion("v2.4.26-a-b", "v2.4.27-a-c"))
        println(compVersion("v2.4.27-a-b", "v2.4.27-a-b"))
        println(compVersion("v2.4.27.1-a-b", "v2.4.27-a-b"))
        println(compVersion("v2.4.27.11-a-b", "v2.4.27.2-a-b"))
        println(compVersion("v2.4.27.11-a-b", "v2.4.27.22-a-b"))
        println(compVersion("v2.4.27.11-a-b", "v2.4.28-a-b"))
        println(compVersion("v2.4.27.12555555-a-b", "v2.4.27.0.0.0-a-b"))
        println(compVersion("v2.4.27.11.22.33.44.55.6-a-b", "v2.4.27.11.22.33.44.55-a-b"))
        println(compVersion("v2.4.27.11.22.33.44.55-a-b", "v2.4.27.11.22.33.44.55.6-a-b"))
        println(compVersion("v2.4.28", "v2.4.27.1.2.2.3.5.0-a-b"))
        println(compVersion("v2.4.28.0.0.1-a-b", "v2.4.28.0..0.0.0.0.0.0.0.0.2-a-b"))
        println(compVersion("v2.4.28-a-b", "v2.4.28.0"))


        compVersion("v2.4.28", "v2.4.28.0")     //小于
        compVersion("v2.4.28.0", "v2.4.28.0.0.0")   //小于
        compVersion("v2.4.28..2", "v2.4.28.0.1")  //小于
        compVersion("v2.4.28.100", "v2.4.28.a")  //小于
        compVersion("v2.4.28.100", "v2.4.28.a")  //小于

    }

    fun compVersion(device: String, target: String): Boolean {
        println("$device  --  $target")
        return EboUtils.isNewVersion(device, target)
    }
}